-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support underline and inverse in ANSI escape codes #2186
Conversation
* Parse underline and inverse in ANSI escape codes * Add CSS classes for same, using a subtle outline for inverse
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I briefly tested this and it appears to be working.
tools/tests/ANSI Test.ipynb
Outdated
"print()\n", | ||
"print (\"{ESC}04mThis is underlined text\".format(**locals()))\n", | ||
"print()\n", | ||
"print (\"{ESC}07mThis is inverse text\".format(**locals()))" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it intentional that you don't reset the style between lines, so this actually generates:
- normal
- bold
- bold + underlined
- bold + underlined + inverse
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, good catch. I've updated the test to reset.
Great, thanks. This looks good to me. |
The "inverse" escape sequence was implemented in jupyter#2186, but not by actually inverting foreground and background.
The "inverse" escape sequence was implemented in jupyter#2186, but not by actually inverting foreground and background.
The "inverse" escape sequence was implemented in jupyter#2186, but not by actually inverting foreground and background.
* Invert inverse ANSI colors The "inverse" escape sequence was implemented in #2186, but not by actually inverting foreground and background. * ANSI colors: allow switching off underline and inverse * Add CSS classes ansi-default-inverse-fg and ...-bg
I was dumping output from cdiff into a notebook and noticed that its use of underline and inverse escape codes wasn't being reflected in the notebook output. A couple simple tweaks to the ANSI parsing and some added CSS classes and it now does.